export default class PropertiesCopyUtils {
  public static copy<T>(sourceArray: Array<any>, targetObject: T): T {
    for (let sourceObject of sourceArray) {
      if (sourceObject == null || targetObject == null) return targetObject
      sourceObject = JSON.parse(JSON.stringify(sourceObject))
      for (const prop in targetObject) {
        if (Object.prototype.hasOwnProperty.call(sourceObject, prop)) {
          targetObject[prop] = sourceObject[prop]
        }
      }
    }
    return targetObject
  }
}
